﻿using System;
using System.Collections.Generic;
using SortOf;
namespace ExampleSortingBenchmark
{
    class Program
    {
        static void Main(string[] args)
        {
            #region Fill Lists

            Random random = new Random();
            IList<int> smallList = new List<int>();
            IList<int> mediumList = new List<int>();
            IList<int> largeList = new List<int>();

            for (int i = 0; i < 1000; i++)
            {
                smallList.Add(random.Next(0, 1000));
            }

            for (int i = 0; i < 10000; i++)
            {
                mediumList.Add(random.Next(0, 10000));
            }

            for (int i = 0; i < 100000; i++)
            {
                largeList.Add(random.Next(0, 100000));
            }
            #endregion
            #region Instantiate Sorting Algorithms
            //Instantiate All Sorting Algorithms
            ISort bubbleSort = new BubbleSort();
            ISort heapSort = new HeapSort();
            ISort insertionSort = new InsertionSort();
            ISort mergeSort = new MergeSort();
            ISort quickSort = new QuickSort();
            ISort selectionSort = new SelectionSort();
            ISort shellSort = new ShellSort();
            #endregion
            #region small (1000) Sort

            bubbleSort.Apply<int>(smallList);
            heapSort.Apply<int>(smallList);
            insertionSort.Apply<int>(smallList);
            mergeSort.Apply<int>(smallList);
            quickSort.Apply<int>(smallList);
            selectionSort.Apply<int>(smallList);
            shellSort.Apply<int>(smallList);

            #endregion
            #region medium (10000) Sort

            bubbleSort.Apply<int>(mediumList);
            heapSort.Apply<int>(mediumList);
            insertionSort.Apply<int>(mediumList);
            mergeSort.Apply<int>(mediumList);
            quickSort.Apply<int>(mediumList);
            selectionSort.Apply<int>(mediumList);
            shellSort.Apply<int>(mediumList);

            #endregion
            #region large (100000) Sort

            bubbleSort.Apply<int>(largeList);
            heapSort.Apply<int>(largeList);
            insertionSort.Apply<int>(largeList);
            mergeSort.Apply<int>(largeList);
            quickSort.Apply<int>(largeList);
            selectionSort.Apply<int>(largeList);
            shellSort.Apply<int>(largeList);

            #endregion
        }
    }
}
